package function;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

public class MyFunctionTest {

	@Before
	public void setUp() throws Exception {
	}

	@Test
	public void testIsANumber() {
		assertEquals(true,MyFunction.isANumber("123"));
		assertEquals(false,MyFunction.isANumber("A123"));
		assertEquals(false,MyFunction.isANumber(" 123"));
		assertEquals(false,MyFunction.isANumber("12a3"));
		assertEquals(false,MyFunction.isANumber("123a"));
		assertEquals(true,MyFunction.isANumber("0000"));
		assertEquals(false,MyFunction.isANumber("-123"));
	}
	
	@Test
	public void testIsValidScore(){
		assertEquals(true,MyFunction.isValidScore("100"));
		assertEquals(true,MyFunction.isValidScore("10"));
		assertEquals(true,MyFunction.isValidScore("0"));
		assertEquals(false,MyFunction.isValidScore("101"));
		assertEquals(false,MyFunction.isValidScore("-1"));
		assertEquals(false,MyFunction.isValidScore("10s0"));
		assertEquals(true,MyFunction.isValidScore("1"));
		assertEquals(true,MyFunction.isValidScore("99"));
	}

}
